#pragma once
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

namespace SCION_RENDERING
{
  // 正交相机
  class Camera2D
  {
  private:
    int m_Width, m_Height;
    float m_Scale; // ����ƴд��m_sCale -> m_Scale

    glm::vec2 m_Position;
    glm::mat4 m_CameraMatrix, m_OrthoProjection;

    bool m_bNeedsUpdate;

  public:
    Camera2D();
    Camera2D(int width, int height);
    void update();

    // ��ȡ����
    inline glm::mat4 GetCameraMatrix()
    {
      return m_CameraMatrix;
    }
    inline void SetScale(float scale)
    {
      m_Scale = scale;
      m_bNeedsUpdate = true;
    }
    // ����λ��
    inline void SetPosition(const glm::vec2 &position)
    {
      m_Position = position;
      m_bNeedsUpdate = true;
    }
    inline const glm::vec2 GetPosition() const
    {
      return m_Position;
    }
    inline const float GetScale() const
    {
      return m_Scale;
    }
  };
}